Object.create = function (proto, propertiesObject) {
  const assert = (condition, msg) => {
    if (!condition) {
      throw new Error(msg)
    }
  }
  assert(
    typeof proto == 'object' || typeof proto == 'function',
    'prototype must be object or null'
  )
  assert(propertiesObject === null, 'propertiesObject can not be null')
  const obj = {}
  obj.__proto__ = proto
  if (propertiesObject != undefined) {
    Object.defineProperties(obj, propertiesObject)
  }
  return obj
}
